<extend name="Index/index" />
<block name="main">
	<div class="row-fluid sortable">		
				<div class="box span12">
					<div class="box-header well" data-original-title>
						<!-- <h2><i class="icon-user"></i> Members</h2> -->
						<div class="box-icon">
							<a href="#" class="btn btn-setting btn-round"><i class="icon-cog"></i></a>
							<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a>
							<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
						</div>
					</div>
					<form action="<{:U('Img/upload')}>" method='post' enctype='multipart/form-data'>
						<input type="hidden" name='mid' value="<{$d}>">
						<input type="file" name="icon" value =""><br>
						<input type="submit" value='上传图片'>
					</form>
					<div class="box-content">
						<table class="table table-striped table-bordered bootstrap-datatable datatable">
						  <thead>
							  <tr>
								  <th>图片编号</th>
								  <th>图片名</th>
								  <th>封面</th>
								  <th>操作</th>
							  </tr>
						  </thead>   
						  <tbody>
							<!-- start volist -->
							<empty name="list">
								<tr>
									<td colspan=5><{$row}></td>
								</tr>
							<else />
						  	<volist name="list" id="vo">

								<tr>
									<td><{$vo.id}></td>
									<td class="center"><img src="__ROOT__/Uploads/<{$vo.icon|substr=0,8}>/<{$vo.icon|substr=8}>" width=60 height=50></td>
									<td><a href="#" class="btn btn-change label label-success icon-white d" bz="<{$vo.id}>"><if condition="$vo.face eq '1'">封面<else />非封</if></a></td>
									<td class="center">
										<a class="btn btn-danger" href="<{:U('Img/delete',array('id'=>$vo['id']))}>">
											<i class="icon-trash icon-white"></i> 
											删除
										</a>
									</td>
								</tr>
							
							</volist> <!-- end volist -->
							</empty>
						  </tbody>
						  <{$page}>
					  </table>            
					</div>
				</div><!--/span-->
			
			</div><!--/row-->
<script>
	$ (function () 
	{
		
		$('.d').click (function ()
		{
			
			var id = $(this).attr ('bz');
			_this = $(this);
			// console.log(id);
			$.ajax ({
				type:'get',
				url:"<{:U('Img/update')}>",
				data:{id:id},
				success:function (data)
				{
					console.log(data);
					$('.d').html('非封');
					_this.html (data);
				},
				
			})
		})
	})
</script>
</block>